﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using OneStop.Calculations;

namespace OneStop.UI
{
    public class MODFormatConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return Format(value, parameter);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return Format(value, parameter);
        }

        object Format(object value, object param)
        {
            double d = (double)value;

            return string.Format(@"{0}{1} @ {2}", d.ToString("F0"), Prefs.Current.DepthShortString, param);
        }

        #endregion
    }

}
